<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 联想
  Date: 2020/2/26
  Time: 17:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>SB Admin 2 - Tables</title>

    <!-- Custom fonts for this template -->
    <link href="${pageContext.request.contextPath}/static/stuLogin/vendor/fontawesome-free/css/all.min.css"
          rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
          rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="${pageContext.request.contextPath}/static/stuLogin/css/sb-admin-2.min.css" rel="stylesheet">

    <!-- Custom styles for this page -->
    <link href="${pageContext.request.contextPath}/static/stuLogin/vendor/datatables/dataTables.bootstrap4.min.css"
          rel="stylesheet">

</head>
<body id="page-top">

<!-- Page Wrapper -->
<div id="wrapper">
    <!-- Content Wrapper -->
    <div id="content-wrapper" class="d-flex flex-column">

        <!-- Begin Page Content -->
        <div class="container-fluid">

            <!-- Page Heading -->
            <h1 class="h3 mb-2 text-gray-800">Tables</h1>
            <p class="mb-4">DataTables is a third party plugin that is used to generate the demo table below. <span style="color: red">${errorRemoveMsg}</span>
                <span style="color: green">${rightRemoveMsg}</span></p>

            <!-- DataTales Example -->
            <div class="card shadow mb-4">
                <div class="card-header py-3">
                    <h6 class="m-0 font-weight-bold text-primary">参加活动的学生</h6>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                            <thead>
                            <tr>
                                <th>学生学号</th>
                                <th>学生姓名</th>
                                <th>学生班级</th>
                                <th>学生专业</th>
                                <th>学生性别</th>
                                <th>学生电话</th>
                                <th>学生邮件</th>
                                <th>报名时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tfoot>
                            <tr>
                                <th>学生学号</th>
                                <th>学生姓名</th>
                                <th>学生班级</th>
                                <th>学生专业</th>
                                <th>学生性别</th>
                                <th>学生电话</th>
                                <th>学生邮件</th>
                                <th>报名时间</th>
                                <th>操作</th>
                            </tr>
                            </tfoot>
                            <tbody>
                            <c:forEach var="activitypeople" items="${list}">
                                <tr>
                                    <td name="studentNo">${activitypeople.getStudents().studentNo}</td>
                                    <td>${activitypeople.getStudents().studentName}</td>
                                    <td>${activitypeople.getStudents().studentClass}</td>
                                    <td>${activitypeople.getStudents().studentMajor}</td>
                                    <td>${activitypeople.getStudents().studentSex}</td>
                                    <td>${activitypeople.getStudents().studentTell}</td>
                                    <td>${activitypeople.getStudents().studentEmail}</td>
                                    <td>${activitypeople.getAddTime()}</td>
                                    <td>

                                        <c:choose>
                                            <c:when test="${Identity == 'admin'}"><!-- 如果是管理员身份 -->

                                                <a href="${pageContext.request.contextPath}/admin/toViewStuActivity?studentNo=${activitypeople.getStudents().studentNo}" class="btn btn-primary btn-icon-split">
                    <span class="icon text-white-50">
                      <i class="fas fa-flag"></i>
                    </span>
                                                    <span class="text">查看此学生参加过的活动</span>
                                                </a>

                                                <a href="${pageContext.request.contextPath}/teacher/passApplyMsg?studentNo=${activitypeople.getStudents().studentNo}&activityNo=${activitypeople.getActivityNo()}" class="btn btn-info btn-icon-split">
                    <span class="icon text-white-50">
                      <i class="fas fa-info-circle"></i>
                    </span>
                                                    <span class="text">老师批注</span>
                                                </a>

                                            </c:when>

                                            <c:when test="${Identity == 'teacher'}"><!-- 如果是管理员身份 -->

                                                <a href="${pageContext.request.contextPath}/teacher/passApplyMsg?studentNo=${activitypeople.getStudents().studentNo}&activityNo=${activitypeople.getActivityNo()}" class="btn btn-info btn-icon-split">
                    <span class="icon text-white-50">
                      <i class="fas fa-info-circle"></i>
                    </span>
                                                    <span class="text">老师批注</span>
                                                </a>

                                            </c:when>

                                            <c:otherwise> <!-- 否则 -->

                                                <a href="${pageContext.request.contextPath}/teacher/toRemove?activityNo=${activitypeople.activityNo}&studentNo=${activitypeople.getStudents().studentNo}" class="btn btn-danger btn-icon-split">
                    <span class="icon text-white-50">
                      <i class="fas fa-trash"></i>
                    </span>
                                                    <span class="text">删除</span>
                                                </a>

                                            </c:otherwise>
                                        </c:choose>

                                    </td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

        </div>
        <!-- /.container-fluid -->

    </div>
    <!-- End of Content Wrapper -->

</div>
<!-- End of Page Wrapper -->

<!-- Bootstrap core JavaScript-->
<script src="${pageContext.request.contextPath}/static/stuLogin/vendor/jquery/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/static/stuLogin/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- Core plugin JavaScript-->
<script src="${pageContext.request.contextPath}/static/stuLogin/vendor/jquery-easing/jquery.easing.min.js"></script>

<!-- Custom scripts for all pages-->
<script src="${pageContext.request.contextPath}/static/stuLogin/js/sb-admin-2.min.js"></script>

<!-- Page level plugins -->
<script src="${pageContext.request.contextPath}/static/stuLogin/vendor/datatables/jquery.dataTables.min.js"></script>
<script src="${pageContext.request.contextPath}/static/stuLogin/vendor/datatables/dataTables.bootstrap4.min.js"></script>

<!-- Page level custom scripts -->
<script src="${pageContext.request.contextPath}/static/stuLogin/js/demo/datatables-demo.js"></script>
</body>
</html>